<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="${mapperXML_packageName}.${mapperXML_tablename}">

    <resultMap id="${mapperXML_tablename}DtoResultMap" type="${mapperXML_packageName}.dto.${mapperXML_tablename}Dto"></resultMap>

    <update id="status" parameterType="java.lang.String">
        update ${mapperXML_tablename?uncap_first} a set a.userflag=abs(userflag-1),a.update=CURRENT_TIMESTAMP WHERE a.id=${r'#{id}'}
    </update>
    <update id="batchNuUseIds" parameterType="java.util.List">
        update ${mapperXML_tablename?uncap_first} a set a.userflag=1,a.update=CURRENT_TIMESTAMP WHERE a.id in
        <foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
        ${r'#{item}'}
        </foreach>
    </update>
    <update id="batchUseIds" parameterType="java.util.List">
        update ${mapperXML_tablename?uncap_first} a set a.userflag=0,a.update=CURRENT_TIMESTAMP WHERE a.id in
        <foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
        ${r'#{item}'}
        </foreach>
    </update>
</mapper>